package org.grow.pointcolor.widget;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.swing.*;
import java.awt.*;
import java.util.concurrent.atomic.AtomicInteger;

@Component
public class Console extends JTextArea {
    public Console() {
        super(10, 40);
    }
//    输出条目前缀计数
    private AtomicInteger index = new AtomicInteger(0);

    public static final Color initColor = new Color(205, 205, 205);
    public AtomicInteger getIndex() {
        return index;
    }

    @PostConstruct
    public void springInit(){
        setFont(new Font("楷体", Font.BOLD, 16));
        setBackground(initColor);
        setLineWrap(true);
    }
}
